#ifndef APP_CONTEXT_H
#define APP_CONTEXT_H

#include "v4l2.h"
#include "drm_device.h"
#include "rk_aiq.h"
#include "pipeline.h"
#include "rknn_engine.h"
#include "rga_util.h" // Include the new RGA utility header

typedef struct app_config
{
    // V4L2 Configuration
    const char *video_device;
    int capture_width;
    int capture_height;
    unsigned int capture_format;
    unsigned int buffer_count;

    // DRM Configuration
    const char *drm_module;
    unsigned int drm_format;

    // AIQ Configuration
    const char *sensor_entity_name;
    const char *iq_files_path;

    // RKNN Configuration
    const char *rknn_model_path;
} app_config_t;
/**
 * @brief The main application context.
 *
 * This structure holds the state and contexts of all modules that
 * constitute the application, providing a centralized data structure.
 */
typedef struct app_context
{
    app_config_t config;

    v4l2_context_t v4l2_ctx;
    drm_device_t drm_ctx;
    rk_aiq_sys_ctx_t *aiq_ctx;
    pipeline_context_t pipeline_ctx;
    rknn_engine_context_t rknn_engine_ctx; // NPU engine context
    rga_context_t rga_ctx;                 // RGA hardware accelerator context

    volatile bool *quit_flag;

} app_context_t;

#endif // APP_CONTEXT_H
